package com.qumitech.visualnovel.datasource.console;

import com.qumitech.visualnovel.model.dao.console.AccountRegister;
import com.qumitech.visualnovel.pubdef.dto.associate.AssociateAccountDTO;
import com.qumitech.visualnovel.pubdef.dto.register.VirtualAccountInfoDTO;
import com.qumitech.visualnovel.pubdef.dto.register.VirtualAccountDTO;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

public interface AccountRegisterMapper {
    int deleteByPrimaryKey(Long id);

    int insert(AccountRegister record);

    int insertSelective(AccountRegister record);

    AccountRegister selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(AccountRegister record);

    int updateByPrimaryKey(AccountRegister record);

    List<AccountRegister> getList(@Param("accountId") Integer accountId,
                                  @Param("startTime")String startTime,
                                  @Param("endTime")String endTime,
                                  @Param("appId")String appId,
                                  @Param("gameType")String gameType,
                                  @Param("appChannel") String appChannel,
                                  @Param("offset") int offset,
                                  @Param("pageSize") int pageSize,
                                  @Param("orderBy") String orderBy,
                                  @Param("orderType") String orderType);

    int getCount(@Param("accountId") Integer accountId,
                 @Param("startTime")String startTime,
                 @Param("endTime")String endTime,
                 @Param("appId")String appId,
                 @Param("gameType")String gameType,
                 @Param("appChannel") String appChannel);


    List<HashMap<String, String>> getRank(@Param("dimension") String dimension,
                                          @Param("startTime")String startTime,
                                          @Param("endTime")String endTime );

    List<AssociateAccountDTO> listAccountByDimension(@Param("dimension") String dimension,
                                                     @Param("dimensionValue") String dimensionValue,
                                                     @Param("startTime") String startTime,
                                                     @Param("endTime") String endTime,
                                                     @Param("orderType") String orderType,
                                                     @Param("orderBy") String orderBy,
                                                     @Param("offset") Integer offset,
                                                     @Param("limit") Integer limit);
    int countAccountByDimension(@Param("dimension") String dimension,
                                @Param("dimensionValue") String dimensionValue,
                                @Param("startTime") String startTime,
                                @Param("endTime") String endTime);

    List<HashMap<String, String>> listRankByDimension(@Param("dimension") String dimension,
                                                     @Param("startTime") String startTime,
                                                     @Param("endTime") String endTime,
                                                     @Param("orderType") String orderType,
                                                     @Param("orderBy") String orderBy,
                                                     @Param("offset") Integer offset,
                                                     @Param("limit") Integer limit);

    int countRankByDimension(@Param("dimension") String dimension,
                             @Param("startTime") String startTime,
                             @Param("endTime") String endTime);

    String getDeviceIdByAccountId(@Param("accountId") Long accountIId);

    List<String> getDeviceIdByAccountIdList(@Param("accountIdList") Long[] accountIdList);

    List<VirtualAccountDTO> statisticVirtualAccounts(@Param("channel") String channel,
                                                     @Param("startTime") String startTime,
                                                     @Param("endTime") String endTime,
                                                     @Param("limit") int limit,
                                                     @Param("offset") int offset);

    Integer countVirtualAccounts(@Param("channel") String channel,
                                 @Param("startTime") String startTime,
                                 @Param("endTime") String endTime);

    List<Integer> listVirtualAccounts(@Param("channel") String channel,
                                      @Param("targetDate") String targetDate);

    List<VirtualAccountInfoDTO> getVirtualAccountSDetail(@Param("accountID") List<Integer> accountID,
                                                         @Param("pageSize") Integer pageSize,
                                                         @Param("offset") Integer offset);

    Integer countVirtualAccountSDetail(@Param("accountID") List<Integer> accountID);

}